Public Class ScanHistory_Factory

    Public Function GetOpenHistory( _
        ByVal lServerID As Long, _
        ByVal lDatabaseID As Long, _
        ByVal sObjectType As String, _
        ByVal lObjectID As Long) As ScanHistory

        Dim oFactory As New DBScanHistory_Factory

        Return oFactory.GetOpenHistory(lServerID, lDatabaseID, sObjectType, lObjectID)
    End Function

    Public Function GetOpenHistory( _
        ByVal lSessionID As Long, _
        ByVal sObjectType As String, _
        ByVal lObjectID As Long) As ScanHistory

        Dim oFactory As New DBScanHistory_Factory

        Return oFactory.GetOpenHistory(lSessionID, sObjectType, lObjectID)
    End Function

    Public Sub RemoveCompletedRequests( _
                    ByVal iMinAgeInDays As Integer)

        Dim oFactory As New DBScanHistory_Factory

        oFactory.RemoveCompletedRequests(iMinAgeInDays)
    End Sub

    Public Function GetCountOfIncompleteRequestsForSession(ByVal lSessionID As Long) As Integer
        Dim oFactory As New DBScanHistory_Factory

        Return oFactory.GetCountOfIncompleteRequestsForSession(lSessionID)
    End Function

    Public Function GetCountOfIncompleteRequestsForDatabase(ByVal lDatabaseID As Long) As Integer
        Dim oFactory As New DBScanHistory_Factory

        Return oFactory.GetCountOfIncompleteRequestsForDatabase(lDatabaseID)
    End Function

    Public Function GetCountOfIncompleteRequestsForServer(ByVal lServerID As Long) As Integer
        Dim oFactory As New DBScanHistory_Factory

        Return oFactory.GetCountOfIncompleteRequestsForServer(lServerID)
    End Function

    Public Sub GetTimeOfLastScan( _
                ByVal lDatabaseID As Long, _
                ByVal lScanTypeID As ScanSchedule.Type, _
                ByVal sObjectType As String, _
                ByRef OUTPUT_ScanInProgressStart As String, _
                ByRef OUTPUT_LastScanComplete As String)

        Dim oFactory As New DBScanHistory_Factory
        oFactory.GetTimeOfLastScan(lDatabaseID, lScanTypeID, sObjectType, OUTPUT_ScanInProgressStart, OUTPUT_LastScanComplete)
    End Sub

    Public Sub GetTimeOfLastScan( _
                    ByVal lDatabaseID As Long, _
                    ByVal lScanTypeID As ScanSchedule.Type, _
                    ByVal sObjectType As String, _
                    ByVal lObjectID As Long, _
                    ByRef OUTPUT_ScanInProgressStart As String, _
                    ByRef OUTPUT_LastScanComplete As String)

        Dim oFactory As New DBScanHistory_Factory
        oFactory.GetTimeOfLastScan(lDatabaseID, lScanTypeID, sObjectType, lObjectID, OUTPUT_ScanInProgressStart, OUTPUT_LastScanComplete)
    End Sub

    Public Sub DeleteExpiredScanHistories()
        Dim oFactory As New DBScanHistory_Factory
        oFactory.DeleteExpiredScanHistories()
    End Sub
End Class
